import java.sql.DriverManager

object Main {
  val url: String = s"jdbc:snappydata://172.16.136.26:1527"
  val conn = DriverManager.getConnection(url)
  def main(args: Array[String]): Unit = {
    SnappySessionHelper.connect("172.16.136.26:1527")
    query_delete_table
  }
  def query_delete_table():Unit={

    /**
     * if delete any table,the app.audit_log table will insert one record,status become DETELE
     * */
    val sql_c = s"select * from app.audit_log where (select Count(1) from app.audit_struct_table where audit_struct_table.objectname= audit_log.objectname) = 0"
    val pre_c = conn.prepareStatement(sql_c)
    val rst_c = pre_c.executeQuery()
    while(rst_c.next())
    {
      println(rst_c.getString("schemaname"),rst_c.getString("objectname"),
        rst_c.getString("objecttype"),rst_c.getString("lastupdatedate"),
        rst_c.getString("objectcreatescript"))

    }
    pre_c.close()
    rst_c.close()

  }

}
